import 'package:fate_blind_box/chat_pages/accounts/binding.dart';
import 'package:fate_blind_box/chat_pages/accounts/view.dart';
import 'package:fate_blind_box/chat_pages/address/binding.dart';
import 'package:fate_blind_box/chat_pages/address/view.dart';
import 'package:fate_blind_box/chat_pages/chat/binding.dart';
import 'package:fate_blind_box/chat_pages/chat/view.dart';
import 'package:fate_blind_box/chat_pages/chat_message_list/binding.dart';
import 'package:fate_blind_box/chat_pages/chat_message_list/view.dart';
import 'package:fate_blind_box/chat_pages/chat_video_player/binding.dart';
import 'package:fate_blind_box/chat_pages/chat_video_player/view.dart';
import 'package:fate_blind_box/chat_pages/friend/apply_add_friend/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/apply_add_friend/view.dart';
import 'package:fate_blind_box/chat_pages/friend/friend_details/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/friend_details/view.dart';
import 'package:fate_blind_box/chat_pages/friend/friend_profile/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/friend_profile/view.dart';
import 'package:fate_blind_box/chat_pages/friend/set_friend/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/set_friend/view.dart';
import 'package:fate_blind_box/chat_pages/friend/set_remarks/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/set_remarks/view.dart';
import 'package:fate_blind_box/chat_pages/friend/verify_friend_apply/binding.dart';
import 'package:fate_blind_box/chat_pages/friend/verify_friend_apply/view.dart';
import 'package:fate_blind_box/chat_pages/group_chat/binding.dart';
import 'package:fate_blind_box/chat_pages/group_chat/view.dart';
import 'package:fate_blind_box/chat_pages/home/binding.dart';
import 'package:fate_blind_box/chat_pages/home/view.dart';
import 'package:fate_blind_box/chat_pages/login/binding.dart';
import 'package:fate_blind_box/chat_pages/login/view.dart';
import 'package:fate_blind_box/chat_pages/pay_manager/identity_verify/view.dart';
import 'package:fate_blind_box/chat_pages/pay_manager/payment_setup/binding.dart';
import 'package:fate_blind_box/chat_pages/pay_manager/payment_setup/view.dart';
import 'package:fate_blind_box/chat_pages/pay_manager/sms_verify/binding.dart';
import 'package:fate_blind_box/chat_pages/pay_manager/sms_verify/view.dart';
import 'package:fate_blind_box/chat_pages/person_home/binding.dart';
import 'package:fate_blind_box/chat_pages/sales_level/binding.dart';
import 'package:fate_blind_box/chat_pages/sales_level/view.dart';
import 'package:fate_blind_box/chat_pages/store/binding.dart';
import 'package:fate_blind_box/chat_pages/store/view.dart';
import 'package:fate_blind_box/chat_pages/system_chat_message/binding.dart';
import 'package:fate_blind_box/chat_pages/system_chat_message/view.dart';
import 'package:fate_blind_box/login_middlewares.dart';
import 'package:fate_blind_box/member_manager_pages/member_add/binding.dart';
import 'package:fate_blind_box/member_manager_pages/member_add/view.dart';
import 'package:fate_blind_box/member_manager_pages/member_code/binding.dart';
import 'package:fate_blind_box/member_manager_pages/member_code/view.dart';
import 'package:fate_blind_box/member_manager_pages/member_list/binding.dart';
import 'package:fate_blind_box/member_manager_pages/member_list/view.dart';
import 'package:fate_blind_box/network/http_config.dart';
import 'package:fate_blind_box/routes/page_route_names.dart';
import 'package:fate_blind_box/ui/main/contact.dart';
import 'package:fate_blind_box/ui/main/home.dart';
import 'package:fate_blind_box/ui/main/navigator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:get/get_navigation/src/routes/get_route.dart';
import 'package:get/get_navigation/src/routes/transitions_type.dart';

import '../../im/addgroupmember.dart';
import '../../im/groupchat.dart';
import '../../im/groupdetilspage.dart';
import '../../im/person_info.dart';
import '../../im/persondetail.dart';
import '../../ui/main/blind_box_2.dart';
import '../../ui/main/personal.dart';
import '../../ui/message/message.dart';
import '../../ui/message/webmessage.dart';
import '../chat_pages/pay_manager/affirm_pay_password/binding.dart';
import '../chat_pages/pay_manager/affirm_pay_password/view.dart';
import '../chat_pages/pay_manager/identity_verify/binding.dart';
import '../chat_pages/pay_manager/set_pay_password/binding.dart';
import '../chat_pages/pay_manager/set_pay_password/view.dart';

abstract class AppPages {
  static RouteObserver<Route> observer = RouteObserver<PageRoute>();

  static final List<GetPage> routes = [
    GetPage(
      name: PageRouteNames.main,
      page: () =>
          (HttpConfig.token.isNotEmpty) ? const HomePage() : const LoginPage(),
      middlewares: [LoginMiddlewares()],
      bindings: [
        HomeBinding(),
        PersonHomeBinding(),
        LoginBinding(),
      ],
    ),
    // 登陆
    GetPage(
        name: PageRouteNames.loginPage,
        page: () => const LoginPage(),
        binding: LoginBinding(),
        transition: Transition.noTransition),
    // home
    GetPage(
      name: PageRouteNames.mainHomepage,
      page: () => const HomeUi(),
    ),
    // 消息
    GetPage(
      name: PageRouteNames.mainMessage,
      page: () => kIsWeb ? const MessageWeb() : const MessageUi(),
    ),
    // 遇见
    GetPage(
      name: PageRouteNames.mainMeet,
      page: () => const BlindBox2Ui(),
    ),
    // 朋友
    GetPage(
      name: PageRouteNames.mainFriends,
      page: () => const ContactUi(),
    ),
    // 我的
    GetPage(
      name: PageRouteNames.mainMine,
      page: () => const PersonalUi(),
    ),
    // 个人主页
    GetPage(
      name: PageRouteNames.personInfoPage,
      page: () => PersonInfo(),
    ),
    // 聊天详情页面
    GetPage(
      name: PageRouteNames.personDetailPage,
      page: () => PersonDatail(),
    ),
// 创建联系人
    GetPage(
      name: PageRouteNames.addGroupMemberPage,
      page: () => AddGroupMember('', '', ''),
    ),
// 组聊天界面
    GetPage(
      name: PageRouteNames.groupChatPage,
      page: () => GroupChat(
        '',
        '',
      ),
    ),
    // tabbar界面
    GetPage(
      name: PageRouteNames.appTabPage,
      page: () => AppMain(),
    ),
    // tabbar界面
    GetPage(
      name: PageRouteNames.groupDetailsPage,
      page: () => GroupDetailsPage('', ''),
    ),
    GetPage(
      name: PageRouteNames.messageList,
      page: () => const ChatMessageListPage(),
      binding: ChatMessageListBinding(),
      // transition: Transition.topLevel
    ),
    GetPage(
      name: PageRouteNames.messageChat,
      page: () => const ChatPage(),
      binding: ChatBinding(),
      // transition: Transition.topLevel
    ),
    GetPage(
      name: PageRouteNames.systemMessageChat,
      page: () => const SystemChatMessagePage(),
      binding: SystemChatMessageBinding(),
      // transition: Transition.topLevel
    ),
    GetPage(
        name: PageRouteNames.videoPlayer,
        page: () => const ChatVideoPlayerPage(),
        binding: ChatVideoPlayerBinding(),
        transition: Transition.noTransition),
    GetPage(
        name: PageRouteNames.meetGroupChat,
        page: () => const GroupChatPage(),
        binding: GroupChatBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.memberList,
        page: () => const MemberListPage(),
        binding: MemberListBinding(),
        transition: Transition.cupertino),

    GetPage(
        name: PageRouteNames.memberAdd,
        page: () => const MemberAddPage(),
        binding: MemberAddBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.memberCode,
        page: () => const MemberCodePage(),
        binding: MemberCodeBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.friendProfile,
        page: () => const FriendProfilePage(),
        binding: FriendProfileBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.friendSetRemake,
        page: () => const SetRemarksPage(),
        binding: SetRemarksBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.friendSetting,
        page: () => const SetFriendPage(),
        binding: SetFriendBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.applyAddFriendPage,
        page: () => const ApplyAddFriendPage(),
        binding: ApplyAddFriendBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.verifyFriendApplyPage,
        page: () => const VerifyFriendApplyPage(),
        binding: VerifyFriendApplyBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.friendDetailsPage,
        page: () => const FriendDetailsPage(),
        binding: FriendDetailsBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.store,
        page: () => const StorePage(),
        binding: StoreBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.address,
        page: () => const AddressPage(),
        binding: AddressBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.salesLevel,
        page: () => const SalesLevelPage(),
        binding: SalesLevelBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.accounts,
        page: () => const AccountsPage(),
        binding: AccountsBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.paymentSetting,
        page: () => const PaymentSetupPage(),
        binding: PaymentSetupBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.phoneVerification,
        page: () => const SmsVerifyPage(),
        binding: SmsVerifyBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.verifyPaymentPassword,
        page: () => const IdentityVerifyPage(),
        binding: IdentityVerifyBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.setPaymentPassword,
        page: () => const SetPayPasswordPage(),
        binding: SetPayPasswordBinding(),
        transition: Transition.cupertino),
    GetPage(
        name: PageRouteNames.confirmPaymentPassword,
        page: () => const AffirmPayPasswordPage(),
        binding: AffirmPayPasswordBinding(),
        transition: Transition.cupertino),
  ];
}
